package org.wanghong.basic.util;

import lombok.Data;
//添加或修改 put
//这是一个Ajax请求，只关心成功与否，如果失败了返回错误信息
//封装一个对象AjaxResult-->{success:true,message:"操作成功",result:{}}
@Data
public class AjaxResult {
    private boolean success = true;
    private String  message = "操作成功！";
    private Object result; //返回数据

    public static AjaxResult me(){
        return new AjaxResult();
    }

    public AjaxResult setSuccess(boolean success) {
        this.success = success;
        return this;//支持链式编程
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public AjaxResult setResult(Object result) {
        this.result = result;
        return this;
    }
}
